content = '''

    #解码
>>> a = "你好 Python".encode("utf-8")
>>> a
b'\xe4\xbd\xa0\xe5\xa5\xbd Python'

    #编码
>>> a.decode("utf")
'你好 Python'

    #混合编码
>>> b = "Python".encode("utf-8") + "你好".encode("gbk")
>>> b
b'Python\xc4\xe3\xba\xc3'
    #解码错误
>>> b.decode("utf")
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "E:\Python\python 3.6.5\Lib\encodings\utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc4 in position 6: invalid continuation byte
    #忽略错误编码
>>> b.decode("utf-8",errors="ignore")
'Python'
    #利用鬼符来替换
>>> b.decode("utf-8",errors="replace")
'Python���'

    #字符串CRUD
    #Create（创建）
>>> a = "hello"
>>> b = "python"
>>> a = a + b
>>> print(a)
hellopython
>>> a += "hellopython"
>>> print(a)
hellopythonhellopython

    #Retrieve（检索）
>>> c = "hello python, hello word"
>>> c[3]
'l'
>>> c.find("o")
4
>>> c.index("o")
4
>>> c.startswith("hello")
True
>>> c.endswith("world")
False

    #Update（更新）
>>> d = "this is a test, hello pythen"
>>> d.replace("hen","hon")
'this is a test, hello python'
>>> d.split(",")
['this is a test', ' hello pythen']
>>> d.split(" ")
['this', 'is', 'a', 'test,', 'hello', 'pythen']
>>> " ".join(d)
't h i s   i s   a   t e s t ,   h e l l o   p y t h e n'

    #Delete（删除）
>>> f = "     this is a test        "
>>> f.strip()
'this is a test'
>>> f.lstrip()
'this is a test        '
>>> f.rstrip()
'     this is a test'

    #格式化
>>> a = 3
>>> b = 7
>>> print ("21={}*{}".format(a,b) )
21=3*7
>>> print("?={1}+{0}*{0}+{1}-{0}".format(a,b))
?=7+3*3+7-3
>>> print("?={b}+{a}*{a}+{b}-{a}".format(a=3,b=7))
?=7+3*3+7-3
>>> print(f"?={b}+{a}*{a}+{b}-{a}")
?=7+3*3+7-3
>>> print("{:.1f}".format(0.618))
0.6

'''